package com.scors.logos.jpa;

import java.io.Serializable;
import java.util.List;

import javax.persistence.EntityManager;

import org.springframework.dao.DataAccessException;

public interface PersistenceJPAGeneric<T> extends Serializable {
    /**
     * Persist a UserImpl entity in the database
     * 
     * @param transientUserImpl
     */
    public void persist(T transientUser)throws DataAccessException;

    /**
     * Remove a persisted UserImpl from the database
     * 
     * @param persistentUserImpl
     */
    public void remove(T persistentUser)throws DataAccessException;

    /**
     * Remove a persisted UserImpl from the database
     * 
     * @param UserImplId
     */
    public void remove(Integer UserId)throws DataAccessException;

    /**
     * Update a UserImpl in the database
     * 
     * @param detachedUserImpl
     * @return merged UserImpl
     */
    public T merge(T detachedUser)throws DataAccessException;

    /**
     * Find a UserImpl by id
     * 
     * @param id
     * @return the found UserImpl
     */
    public T findById(Integer id)throws DataAccessException;

    /**
     * Find a UserImpl by his fullname
     * 
     * @return the found UserImpl
     */
    public List<T> findAll()throws DataAccessException;

    /**
     * Search UserImpls
     * 
     * @param searchString
     * @return the found UserImpls
     */
    public List<T> search(String searchString)throws DataAccessException;

    EntityManager getEntityManager()throws DataAccessException;
}
